<template>
    <div id="tab-control">
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
            <el-tab-pane :key="index" v-for="( option, index) of options" :label="option.label" :name="option.name">
                <slot>

                </slot>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<!--类似于接待计划的选项卡-->
<script>
    import {Tabs, TabPane} from "element-ui";
    import List from "../list/List";
    export default {
        props: {
            options: {
                type: Array,
                required: true
            }
        },
        name: "TabControl",
        components: {
            "el-tabs": Tabs,
            "el-tab-pane": TabPane,
            List
        },
        created() {

        },
        data() {
            return {
                activeName: this.options[0].name,
            };
        },
        methods: {
            handleClick(tab) {
                this.$emit("tabClick", tab.label);
            }
        }
    }
</script>

<style >


</style>
